/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.cip.esymons.general.be;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author ADMINISTRADOR
 */
@Entity
@Table(name = "gen_via")
@NamedQueries({@NamedQuery(name = "Via.findAll", query = "SELECT v FROM Via v"), @NamedQuery(name = "Via.findByViaCodigo", query = "SELECT v FROM Via v WHERE v.viaCodigo = :viaCodigo"), @NamedQuery(name = "Via.findByViaAcronimo", query = "SELECT v FROM Via v WHERE v.viaAcronimo = :viaAcronimo"), @NamedQuery(name = "Via.findByViaNombre", query = "SELECT v FROM Via v WHERE v.viaNombre = :viaNombre")})
public class Via implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "via_codigo")
    private Integer viaCodigo;
    @Basic(optional = false)
    @Column(name = "via_acronimo")
    private String viaAcronimo;
    @Basic(optional = false)
    @Column(name = "via_nombre")
    private String viaNombre;
    @OneToMany(mappedBy = "viaCodigo", fetch = FetchType.LAZY)
    private List<DireccionPersona> direccionPersonaCollection;

    public Via() {
    }

    public Via(Integer viaCodigo) {
        this.viaCodigo = viaCodigo;
    }

    public Via(Integer viaCodigo, String viaAcronimo, String viaNombre) {
        this.viaCodigo = viaCodigo;
        this.viaAcronimo = viaAcronimo;
        this.viaNombre = viaNombre;
    }

    public Integer getViaCodigo() {
        return viaCodigo;
    }

    public void setViaCodigo(Integer viaCodigo) {
        this.viaCodigo = viaCodigo;
    }

    public String getViaAcronimo() {
        return viaAcronimo;
    }

    public void setViaAcronimo(String viaAcronimo) {
        this.viaAcronimo = viaAcronimo;
    }

    public String getViaNombre() {
        return viaNombre;
    }

    public void setViaNombre(String viaNombre) {
        this.viaNombre = viaNombre;
    }

    public List<DireccionPersona> getDireccionPersonaCollection() {
        return direccionPersonaCollection;
    }

    public void setDireccionPersonaCollection(List<DireccionPersona> direccionPersonaCollection) {
        this.direccionPersonaCollection = direccionPersonaCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (viaCodigo != null ? viaCodigo.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Via)) {
            return false;
        }
        Via other = (Via) object;
        if ((this.viaCodigo == null && other.viaCodigo != null) || (this.viaCodigo != null && !this.viaCodigo.equals(other.viaCodigo))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "org.cip.esymons.general.be.Via[viaCodigo=" + viaCodigo + "]";
    }

}
